﻿using System.IO;
using System.Net;
using System.Xml.Linq;

namespace Web.NetworkWorkers
{
	//TODO create tests (переход по инвалидому url)
	public class NetworkHelper : INetworkHelper
	{
		public XDocument GetXML(string url)
		{
			var wc = new WebClient();
			var xmlBytes = wc.DownloadData(url);
			using (var ms = new MemoryStream(xmlBytes))
			{
				return XDocument.Load(ms);
			}
		}
	}
}